<template>
  <div class="city">
    <van-nav-bar title="标题" left-text="返回" left-arrow @click-left="leftCheck">
      <template #title>
        城市选择页面
      </template>
    </van-nav-bar>
    <van-index-bar>
      <van-index-anchor v-for="(item,index) in dataList.cities" :key="index" :index="index">
        <div>{{index}}</div>
        <van-cell :title="value.name" v-for="value in item" :key="value.id"/>
      </van-index-anchor>
    </van-index-bar>
  </div>
</template>

<script>
export default {
  data () {
    return {
      dataList:{}
    }
  },
  created () {
    this.$http("/api/city").then(res=>{
        this.dataList=res.data
        console.log(this.dataList);
    })
  },
  methods: {
    leftCheck(){
      this.$router.go(-1)
    }
  }
}
</script>
